#include<iostream>
#include<string>
using namespace std;

int main()
{
	int n = 0;
	cin >> n;
	string s1;
	string s2;
	while(n--)
	{
		cin >> s1;
		cin >> s2;
		if(s1 == s2)
			cout << "Tie" << endl;
		else if(s1 == "Rock" && s2 == "Scissors")
			cout << "Player1" << endl;
		else if(s1 == "Scissors" && s2 == "Paper")
			cout << "Player1" << endl;
		else if(s1 == "Paper" && s2 == "Rock")
			cout <<  "Player1" << endl;
		else
			cout << "Player2" << endl;
	}
	
	return 0;
}
